from flask.json import jsonify
from app import create_app, db
from app.model import History
from flask_migrate import Migrate, upgrade

# 开发环境
app = create_app('development')
migrate = Migrate(app, db)

@app.shell_context_processor
def make_shell_context():
    return dict(db=db, History=History)

@app.cli.command()
def deploy():
    """Run deployment"""
    # migrate数据库到最近版本
    upgrade()


@app.route('/')
def index():
    return jsonify(code=0, msg='ALOHA!')




